<?php

namespace app\admin\validate;

use think\Validate;

class UserValidate extends Validate
{
    // 定义验证规则
    protected $rule = [
        'id'  => 'require|number',
        'username' => 'require',
        'password' => 'require',
        'useremail' => 'require|email',
        'nickname'  => 'require',
        'usertx'   => 'require',
        'qq'    => 'require|number',
        'useremail'    => 'require|email',
        'title'    => 'require',
        'viptime'    => 'require',
        'money'    => 'require|number',
        'exp'    => 'require|number',
        'banned'    => 'require',
        'banned_reason'    => 'require',
        'appid' => 'require',
    ];

    //定义验证场景
    protected $scene = [
        'updateuser'  =>  ['id','nickname','usertx','qq','useremail','title','viptime','money','exp','banned'],
        'adduser' => ['username','password','useremail','appid'],
    ];
}